package com.project.user.controller;

import com.project.user.entity.entitly.LoginToken;
import com.project.user.entity.entitly.UserInfo;

public interface UserTokenController {

    /**
     * create a new user token after user login
     *
     * @param userInfo          userinfo
     * @param loginSessionId    login session
     * @param loginIpv4         user ipV4 address
     * @param loginIpaddress    user address
     * @param loginSuccessfully user login successfully
     * @return create new user toke
     * @throws Exception sqlExample
     */
    int CreateLoginToken(UserInfo userInfo, String loginIpv4, String loginIpaddress, String loginSuccessfully,String loginSessionId) throws Exception;

    /**
     * select user token or userinfo
     *
     * @param userInfo          user info
     * @param loginSuccessfully user login successfully
     * @param userSession       user login session
     * @return user token query
     * @throws Exception sqlExample
     */
    LoginToken CheckLoginToken(UserInfo userInfo, String loginSuccessfully, String userSession) throws Exception;

    /**
     * update user token
     *
     * @param userToken user token object
     * @return update user token
     * @throws Exception sqlExample
     */
    int updateLoginToken(LoginToken userToken) throws Exception;
}
